package cn.net.isir.service;

import cn.net.isir.core.BasicService;
import cn.net.isir.core.SetBasicDao;
import cn.net.isir.dao.MessageDao;
import cn.net.isir.dao.OrganizationsDao;
import cn.net.isir.entity.Message;
import cn.net.isir.entity.Organizations;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrganizationsService extends BasicService<Organizations> {
    @SetBasicDao
    @Resource
    private OrganizationsDao organizationsDao;
    /**
     * 查询组织机构列表
     *
     * @param parameter 参数
     * @return 列表页
     */
    @Override
    public PageInfo selectListByUser(Object parameter) {
        Organizations organizations = (Organizations) parameter;
        return super.selectPageList(organizations, organizations.getPageNo(), organizations.getPageSize());
    }

    /**
     * 查询当下所有id的子组织机构
     *
     * @param id id
     * @return 列表
     */
    public List<Organizations> selectSubList(String id) {
        return organizationsDao.selectSubList(id);
    }
}
